<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>后台管理系统</title>
<js href="__PUBLIC__/Js/Jquery/jquery-1.4.4.min.js" />
<link href="../Public/admin/css/golbal.css" rel="stylesheet" type="text/css" />
<link href="../Public/admin/css/notice.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div class="tittle">
<span>专题管理</span>
<a href="{:U('Topic/addtopic')}">添加专题</a>
</div>
<div class="detab">
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr class="thi">
<th width="253">专题标题</th>
<th width="442">专题图片</th>
<th width="253">专题状态 </th>
<th width="123">操作</th>
</tr>
<volist id='vo' name='list'>
<tr>
<td>{$vo.toptitle|msubstr=###,0,8}</td>
<td><img src="__PUBLIC__/Admin/Topic/m_{$vo.topimg}"></img></td>
<eq name="vo['status']" value="0">
<td class="forbid"><span>否</span><a href="javascript:void(0);" onclick="enable({$vo.topid});"> </a></td>
<else/>
<td class="start"><span>是</span><a href="javascript:void(0);" onclick="forbidden({$vo.topid});"> </a></td>
</eq>
<td class="last_bt"><a href="{:U('Topic/edit',array('topid'=>$vo['topid']))}" class="edit">编辑</a><a href="{:U('Topic/move',array('topid'=>$vo['topid']))}" class="move"onclick="return confirm('确定要删除吗')">删除</a></td>
</tr>
</volist>
</tbody>
</table>
</div>

<div class="num">

</div>
<div class="clear"></div>
<script type="text/javascript">

//禁用
function forbidden(cateid) {
	cateid = cateid ? cateid : getChecked();
	cateid = cateid.toString();
	if(cateid == '' || !confirm('确定要取消启用？')) return false;
	$.post("{:U('Topic/forbidden')}", {topid:cateid}, function(res){
		if(res == '1') location.href = location.href;
		else alert('禁用失败');
	});
}

//启用
function enable(cateid) {
	cateid = cateid ? cateid : getChecked();
	cateid = cateid.toString();
	$.post("{:U('Topic/enable')}", {topid:cateid}, function(res){
		if(res == '1') location.href = location.href;
		else alert('激活失败');
	});
}
</script>
</body>
</html>
